﻿@model  Logic.Models.TaskCreateModel

@{
    Layout = null;
}
    
    <div class="HeaderContainer">
        <div class="TaskHeader">
        <img src="@(Logic.Constants.CurrentUrl)/Images/TaskBigIcon.png" class="Icon TaskIcon"/>
        <div class="Property Name">
        @Html.TextBox("Name", "", new { Class = "FormInput Input", style = "width:480px" })
        <div id="parentName"></div>
        </div>
        <div class="Property Status" style="width:auto; margin-left:10px;position:relative" >
            <span class="Background1 Status">
                <img id='statusImg'/>
            </span>
            <a id='stateMenu' iconCls="icon-draft" m-text='Set state'>
                <div id="mm" style="width:150px;">  
                    <div id='MarkAsDraft' class="draft"  iconCls="icon-draft" display-text='Draft'>Mark as Draft</div>  
                    <div display-text='Active' id='Activate' class="active" iconCls="icon-activate">Activate</div>  
                    <div display-text='On Hold' id='PutOnHold' class="on_hold" iconCls="icon-hold">Put on Hold</div>  
                    <div display-text='Cancelled' id='Cancel' class="cancelled" iconCls="icon-cancel">Cancel</div>  
                    <div display-text='Completed' id='MarkComplete' class="completed" iconCls="icon-complete">Mark Complete</div>  
                </div>
            </a> 
        </div>
    </div>
    </div>
    <div id="task_tabs" class="Input_C">
        <div class="tabHeaderContainer">
	        <ul>
		        <li><a href="#tabs-1">Info</a></li>
		        <li><a href="#Documents" title='Documents'>Documents</a></li>
	        </ul>
        </div>
        <div class="Info_Container" id="tabs-1">
            <input type='hidden' id='ID.Value' name='ID.Value' always_save="true" />
            <input type='hidden' id='ID.TypeName' name='ID.TypeName' value='Task' always_save="true"/>
            <table class="formTable">
                <tr>
                    <td class="Property">
                        <div class="Label">Start Date</div>
                        <div>@Html.TextBox("StartDate", "", new { Class = "Date FormInput" })</div>
                    </td>
                    <td class="Property">
                        <div class="Label">Due date</div>
                        <div><input type="text" name="DueDate" class="Date FormInput"/></div>
                    </td>
                    <td class="Property">
                        <div class="Label">Duration</div>
                        <div class="Duration">
                            <input type="text" class="Numeric FormInput" name="Duration.Value"/>
                            @Html.DropDownList("Duration.Unit", Enum.GetNames(typeof(Logic.ClarizenSvc.DurationUnit)).Select(u => new SelectListItem { Text = u, Value = u, Selected = u == "Days" }), new { Class = "FormInput ddl-menu" }) 
                        </div>
                    </td>
                    <td class="Property">
                        <div class="Label">% Completed</div>
                        <div><input type="text" class="Numeric FormInput" name="PercentCompleted"/></div>
                    </td>
                </tr>   
                <tr>    
                    <td class="Property">
                        <div class="Label">Work</div>
                        <div class="Duration">
                                <input type="text" class="Numeric FormInput" name="Work.Value"/>
                                @Html.DropDownList("Work.Unit", Enum.GetNames(typeof(Logic.ClarizenSvc.DurationUnit)).Select(u => new SelectListItem { Text = u, Value = u, Selected = u == "Days" }), new { Class = "FormInput ddl-menu" }) 
                        </div>
                    </td>
                    <td class="Property">
                        <div class="Label">Actual Effort</div>
                        <div class="Duration">
                            <input type="text" class="Numeric FormInput" name="ActualEffort.Value"/>
                            @Html.DropDownList("ActualEffort.Unit", Enum.GetNames(typeof(Logic.ClarizenSvc.DurationUnit)).Select(u => new SelectListItem { Text = u, Value = u, Selected = u == "Days" }), new { Class = "FormInput ddl-menu" }) 
                        </div>
                    </td>
                    <td class="Property">
                        <div class="Label">Remaining Effort</div>
                        <div class="Duration">
                            <input type="text" class="Numeric FormInput" name="RemainingEffort.Value"/>
                            @Html.DropDownList("RemainingEffort.Unit", Enum.GetNames(typeof(Logic.ClarizenSvc.DurationUnit)).Select(u => new SelectListItem { Text = u, Value = u, Selected = u == "Days" }), new { Class = "FormInput ddl-menu" }) 
                        </div>
                    </td>
                    <td class="Property">
                        <div class="Label">Manager</div>
                        <div><select name="ManagerID" id="AssignedTo" class="FormInput"></select></div>
                    </td>
                    
                </tr>   
                <tr>    
                    <td class="Property">
                        <div class="Label">Status</div>
                        <div>@Html.DropDownList("TrackStatusID", Model.Statuses.Select(u => new SelectListItem { Text = u.Values[0].Value.ToString(), Value = u.Id.Value, Selected = false }), new { Class = "ddl-menu FormInput" })</div>
                    </td>
                    <td class="Property">
                         <div class="Label">Importance</div>
                        <div>@Html.DropDownList("ImportanceID", Model.Importance.Select(u => new SelectListItem { Text = u.Values[0].Value.ToString(), Value = u.Id.Value, Selected = false }), new { Class = "ddl-menu FormInput" })</div>
                    </td>
                    <td class="Property">
                        <div class="Label">Task Type</div>
                        <div>@Html.DropDownList("TaskTypeID", Model.TaskTypes.Select(u => new SelectListItem { Text = u.Values[0].Value.ToString(), Value = u.Id.Value, Selected = false }), new { Class = "ddl-menu FormInput" })</div>
                    </td>
                    <td class="Property" rowspan="2">
                        <div class="Label">Resources</div>
                        <div id='Resources' name='Resources' class='autocomplete FormInput' url='@(Logic.Constants.CurrentUrl)/users/index'></div>
                    </td>
                </tr>
                <tr>
                    <td class="Property" colspan="3">
                        <div class="Label">Description</div>
                        <div><textarea  id="Description" name="Description" rows="5" cols="20"  class="FormInput"></textarea></div>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <div class="CustomContainer">
                             <div class="Label">
                                + Custom Fields
                            </div>
                            <div id="CustomFields">
                            </div>
                            <div style="clear:both"></div>
                        </div>
                    </td>
                </tr>
            </table>
            
            
        </div>
        <div class="Documents_Container" id="Documents">
            @{Html.RenderPartial("~/Views/Documents/_DocumentsTab.cshtml",  new ClarizenGadget.Models.DocumentViewModel{
                AuthorizedGoogle = Model.AuthorizedGoogle,
                DocumentTypes = Model.DocumentTypes,
            });}    
        </div>
    </div>

    

    
    

    
